CREATE TABLE [dbo].[TCCANJ_CLIE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TCCANJ_CL__FA_TI__619B8048] DEFAULT ((1.000)),
[FE_INIC_VMTO] [dbo].[TD_DT_001] NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[NU_LETR_GENE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_CL__NU_LE__628FA481] DEFAULT ((0)),
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TCCANJ_CL__ST_CO__6383C8BA] DEFAULT ('N'),
[ST_PLAZ_VMTO] [dbo].[TD_VC_001] NULL,
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_CL__NU_PR__656C112C] DEFAULT ((0)),
[NU_DIAS_PLAZ] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_CL__NU_DI__66603565] DEFAULT ((0)),
[NU_DIFE_DIAS] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_CL__NU_DI__6754599E] DEFAULT ((0)),
[ST_FECH_VMTO] [dbo].[TD_VC_001] NULL,
[NU_DIAS_MESE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_CL__NU_DI__68487DD7] DEFAULT ((0)),
[ST_DIAS_FMES] [dbo].[TD_VC_001] NULL,
[ST_CANJ] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TCCANJ_CL__ST_CA__693CA210] DEFAULT ('N'),
[PC_INTR_MENS] [dbo].[TD_NU_009_004] NULL CONSTRAINT [DF__TCCANJ_CL__PC_IN__6B24EA82] DEFAULT ((0)),
[IM_GAST_BANC] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TCCANJ_CL__IM_GA__6C190EBB] DEFAULT ((0)),
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCANJ_CL__CO_US__6D0D32F4] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCANJ_CL__FE_US__6E01572D] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCANJ_CL__CO_US__6EF57B66] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCANJ_CL__FE_US__6FE99F9F] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCANJ_CLIE] WITH NOCHECK ADD CONSTRAINT [CK__TCCANJ_CL__ST_CA__6A30C649] CHECK NOT FOR REPLICATION (([ST_CANJ]='N' OR [ST_CANJ]='S'))
GO
ALTER TABLE [dbo].[TCCANJ_CLIE] WITH NOCHECK ADD CONSTRAINT [CK__TCCANJ_CL__ST_CO__6477ECF3] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TCCANJ_CLIE] ADD CONSTRAINT [PK__TCCANJ_C__2F266C75758348BB] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCANJ_CLIE] ADD CONSTRAINT [FK__TCCANJ_CL__CO_EM__78159CA3] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TCCANJ_CLIE] ADD CONSTRAINT [FK__TCCANJ_CLIE__7721786A] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
